package com.gopay.bis.service.bank;

import java.util.List;

import com.gopay.common.domain.bank.BankOrder;
import com.gopay.common.domain.bank.BaseMessage;
import com.gopay.common.domain.bank.BcdlQueryBalance;
import com.gopay.common.domain.bank.BcdlSendBankLog;
import com.gopay.common.domain.bank.SendBankOrderCust;
import com.gopay.common.domain.bis.BisBankBcdlOrder;
import com.gopay.common.domain.bis.RouteMessage;
import com.gopay.common.exception.GopayException;

/**
 * 银行流水Service
 * 
 * @BankOrderService.java
 * @author yaobo
 * @2013-2-5 下午04:01:36 www.gopay.com.cn Inc.All rights reserved.
 */
public interface BankOrderService {
	
    /**
     * 新增银行流水
     * @param base
     * @return
     */
    public BankOrder addBankOrder(BaseMessage base) throws GopayException;
    
    /**
     * 新增上送银行信息
     * @param orderCust
     * @return
     */
    public SendBankOrderCust addSendBankOrder(BaseMessage base) throws GopayException;

    /**
     * 更新银行流水
     * 
     * @param bankOrder
     * @return
     */
    public void updateBankOrder(BankOrder bankOrder);

    /**
     * 获取银行流水
     * 
     * @param orderId
     * @return
     */
    public BankOrder getBankOrderById(String outOrderId);
    
    /**
     * 获取银行流水
     * 
     * @param orderId
     * @return
     */
    public List<BankOrder> getBankOrdersByGopayOrderId(String orderId);

    /**
     * 银行流水更新为[银行返回成功]
     * 
     * @param orderId
     * @return
     */
    public int updateBackSuccess(String outOrderId);
    
    /**
     * 银行流水更新为[银行返回成功]
     * 
     * @param orderId
     * @return
     */
    public int updateBpsSuccess(String outOrderId);
    
    /**
     * 银行流水更新为[银行返回成功]
     * 
     * @param orderId
     * @return
     */
    public int updateBpsFail(String outOrderId);
    
    /**
     * 银行流水更新为[银行返回成功]
     * 
     * @param orderId
     * @return
     */
    public int updateBpsOther(String outOrderId);
    
    /**
     * 银行流水更新为[入账失败]
     * 
     * @param orderId
     * @return
     */
    public int updateInAcctFail(String outOrderId);
    
    /**
     * 根据银行码和查询状态获取查询余额交易记录
     * 
     * @param bankCode
     * @param queryOrderStatus
     * @return
     */
    public List<BcdlQueryBalance> getBcdlQueryByBankCodeAndOrderStatus(String bankCode, String queryOrderStatus);
    
    /**
     * 获取查询余额
     * 
     * @param orderId
     * @return
     */
    public BcdlQueryBalance getBcdlQueryById(String orderId);
    
    /**
     * 新增银企直联查询余额流水
     * @param base
     * @return
     */
    public BcdlQueryBalance addBcdlQueryOrder(BaseMessage base) throws GopayException;
    
    /**
     * 更新银企直联查询流水
     * 
     * @param bcdlQuery
     * @return
     */
    public void updateBcdlQueryOrder(BcdlQueryBalance bcdlQuery);

    /**
     * 新增银行订单操作日志
     * @param bankOrder
     */
    public void addBankOrderDealLog(BankOrder bankOrder) ;
    
    /**
     * 根据原交易银行订单号获取退款银行流水
     * 
     * @param bankOrderId
     * @return
     */
    public List<BankOrder> getBankOrdersByOriBankOrderId(String bankOrderId);
    
    /**
     * 银行自动路由日志
     * 
     * @param routeMessage
     */
    public void addBankRouteLog(RouteMessage routeMessage);
    
    /**
     * 更新银企直联订单
     * 
     * @param bcdlOrder
     * @return
     */
    public void updateBankBcdlOrder(BisBankBcdlOrder bcdlOrder);
    
    /**
     * 获取银企直联订单
     * 
     * @param orderId
     * @return
     */
    public BisBankBcdlOrder getBankBcdlOrderById(String orderId);
    
    /**
     * 获取银企直连发往银行日志记录
     * @param orderId
     * @return
     */
    public BcdlSendBankLog getBcdlSendLogById(String orderId);
    
    /**
     * 删除银企直连发往银行日志记录
     * @param bcdlSendBankLog
     */
    public void deleteBcdlSendLog(BcdlSendBankLog bcdlSendBankLog);
    
}
